﻿#pragma once
#include <QDialog>
#include <QTableWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include "UndoRedo_station.h"

class StationAdminDialog : public QDialog {
    Q_OBJECT // 添加Q_OBJECT宏，支持Qt元对象系统
public:
    StationAdminDialog(QWidget* parent = nullptr);
    void refreshStationTable();
private slots:
    void onAddStation();
    void onDeleteStation();
    void onEditStation();
    void onSearchStation();
private:
    QTableWidget* table;
    QLineEdit* nameEdit;
    QLineEdit* idEdit;
    QLineEdit* searchEdit;
    QPushButton* addBtn;
    QPushButton* deleteBtn;
    QPushButton* editBtn;
	QPushButton* undoBtn;
	QPushButton* redoBtn;
    QPushButton* searchBtn;
    QLabel* infoLabel;
    void showInfo(const QString& msg);
	UndoRedo_station undoRedo; // 用于撤销重做功能
};
